function makeArea(shape: Shape) {
    return shape.getArea()
}

abstract class Shape {
    abstract getArea(): any
}

class Rectangle extends Shape {
    private width: number
    private height: number
    constructor(width: number, height: number) {
        super()
        this.width = width
        this.height = height
    }
    getArea() {
        return this.width * this.height
    }
}

class Circle extends Shape {
    private r: number
    constructor(r: number) {
        super()
        this.r = r
    }
    getArea() {
        return 2 * 3.14 * this.r
    }
}
const r = new Rectangle(20, 30)
const c = new Circle(10)
console.log(makeArea(r))
console.log(makeArea(c))

export{}